<!DOCTYPE html>
<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no">
<meta content="telephone=no" name="format-detection">
<meta name="apple-touch-fullscreen" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<title>订单信息</title>
<link href="/static/css/buy.css" type="text/css" rel="stylesheet">
</head>
<body>
<form id="form_buy" method="post">
<section class="item_sec">
	<div class="item_wrap rel">
		<img src="/up/i/20140721/53cc227282722.jpg" height="70" width="70">
		<p class="item_tle ellipsis">韩国 Belly Mymi 瘦腰神贴</p>
		<p class="item_pay">货到付款并包邮</p>
		<ul class="sku_ul">
<li><a data-price="198.00" data-sku="97">10贴</a></li>
<li><a data-price="396.00" data-sku="98">买20贴送5贴</a></li>
<li><a data-price="792.00" data-sku="99">买40贴送10贴</a></li>
		</ul>
		<input type="hidden" name="item_sku_id" id="item_sku_id" value="">
		<p class="row">
<label>价　格 </label><input type="hidden" id="item_num" name="num" value="1" />
<span class="i_pri" id="item_price">￥198.00</span>
		</p>
	</div>
	</div>
	</div>
</section>
<section class="item_sec">
	<div class="item_wrap add">
		<p class="row">
			<label for="name">收货人</label>
			<input required="required" id="name" name="name" class="block input" tabindex="1" type="text" value="" />
		</p>
		<p class="row">
			<label for="tel">联系手机</label>
			<input required="required" id="tel" name="tel" maxlength="11" class="block input" tabindex="2" type="tel" value="" />
		</p>
		<p class="row">
			<label for="province">选择地区</label>
			<select class="select" id="province" name="province" tabindex="3">
			</select><select class="select" id="city" name="city" tabindex="4">
			</select><select class="select" id="area" name="area" tabindex="5">
			</select>
		</p>
		<p class="row row_area">
			<label for="address">详细地址</label>
			<input required="required" id="address" name="address" class="block input" placeholder="街道门牌信息" tabindex="6" type="text" value="">
		</p>
		<p class="row row_area">
			<label>推荐人</label>
			<input class="block input" tabindex="7" type="text" readonly value="1199">
		</p>
		</div>
</section>
<footer>
	<button type="button" class="c_txt orange_bg" id="buy_now">提交订单</button>
</footer>
</form>
<script src="/static/js/base_H5.js"></script>
<script src="/static/js/PCASClass.js"></script>
<script>
var pcas = new PCAS("province,省份","city,城市","area,地区");
var Item = {
	getItemInfo : function(){
		$(".sku_ul a").bind("click",function(){//尺码点击
			var o = $(this);
			if(!o.hasClass("sku_cur")){//点击的不是当前已经选中的
				$(".sku_cur").removeClass("sku_cur");
				o.addClass("sku_cur");
				/*更新对应的选中尺码的数据*/
				$("#item_price").html("￥"+ o.attr("data-price"));
				$("#item_num").val(1);
				$("#item_sku_id").val(o.attr("data-sku"));
			}
		})
	},
	changeCount : function(){
		$("#item_num").bind("focusout",function(){
			var _this = $(this);
			var val = _this.val();
			if(!val){
				M._alert("数量不可为空");
				_this.val(1);
				return;
			}
			if(isNaN(val)){
				M._alert("数量必须为数字");
				_this.val(1);
				return;
			}
			if(Number(val) < 1){
				M._alert("客官至少买一件嘛");
				_this.val(1);
				return;
			}
			
			var _v = val;
			var noInt = false;
			if(_v.toString().indexOf(".") != -1){//有小数点 则先转化一下
				noInt = true;
				_v = Math.floor(val);//优化后的整数
			}
			noInt && M._alert("数量必须为整数");
			_this.val(_v);
		})
	},
	init : function(){
		Item.changeCount();
		Item.getItemInfo();
		$("#buy_now").bind("click", function() {
			$(this).attr("disabled", "disabled");
			document.getElementById("form_buy").submit();
		});
	}
}
Item.init();
</script>
</body>
</html>